<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html >
<head>
	<meta name="decorator" content="sysDefault" content="text/html; charset=utf-8"/>
	<script src="${staticPath}/js/pospay/opendialog.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#key").focus();
			$("#dataForm").validate({
				submitHandler: function(form){
					Oosp_Loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
			//修改时选择当前下拉框的值
			var payType = "<c:out value="${paymode.payType}"/>";
			if(payType != null && payType != ""){
				$("#payType").val(payType);
			}
			
			//修改时选择当前下拉框的值
			var currenty = "<c:out value="${paymode.currencyId}"/>";
			if(currenty != null && currenty != ""){
				$("#currenty").val(currenty);
			}
		});
		
		$(function(){
			opendialog("${contextPath}/pospay/parent/list","parentId");
		})
	</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">编辑数据
						<a class="btn btn-default btn-sm pull-right" role="button" href="javascript:void(0)" onclick="history.go(-1)">返回</a>
				    </h3>
				  </div>
				  <div class="panel-body">
					<form:form id="dataForm" modelAttribute="paymode" action="${contextPath}/pospay/paymode/save" method="post" class="form-horizontal" role="form">
						<form:hidden path="id"/>
						<tags:message content="${message}"/>
								<div class="form-group">
									<label for="parentId" class="col-sm-2 control-label">父节点ID:</label>
									<div class="col-sm-2">
										<form:input id="parentId" path="parentId" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="paymodeNo" class="col-sm-2 control-label">付款方式编码:</label>
									<div class="col-sm-2">
										<form:input id="paymodeNo" path="paymodeNo" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="paymodeName" class="col-sm-2 control-label">付款方式名称:</label>
									<div class="col-sm-2">
										<form:input id="paymodeName" path="paymodeName" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="payType" class="col-sm-2 control-label">支付类别(银行卡、现金、购物券、购物卡:</label>
									<div class="col-sm-2">
										<form:select id="payType" path="payType" class="form-control">
											<c:forEach items="${codeDList}" var="codeD">
												<form:option value="${codeD.codeNo}">${codeD.codeName}</form:option>
											</c:forEach>
										</form:select>
									</div>
								</div>
								<div class="form-group">
									<label for="currenty" class="col-sm-2 control-label">币种(人民币、港币、美元:</label>
									<div class="col-sm-2">
										<form:select id="currenty" path="currencyId" class="form-control">
											<c:forEach items="${currencyList}" var="currency">
												<form:option value="${currency.currencyNo}">${currency.currencyName}</form:option>
											</c:forEach>
										</form:select>
									</div>
								</div>
								<div class="form-group">
									<label for="isChange" class="col-sm-2 control-label">允许找零:</label>
									<div class="col-sm-2">
										<form:input id="isChange" path="isChange" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="isIntegral" class="col-sm-2 control-label">允许积分:</label>
									<div class="col-sm-2">
										<form:input id="isIntegral" path="isIntegral" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="isCoupons" class="col-sm-2 control-label">允许兑券:</label>
									<div class="col-sm-2">
										<form:input id="isCoupons" path="isCoupons" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="statistics" class="col-sm-2 control-label">统计类型(是否统计该级别的付款方式，比如银行卡下:</label>
									<div class="col-sm-2">
										<form:input id="statistics" path="statistics" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="enabled" class="col-sm-2 control-label">是否禁用:</label>
									<div class="col-sm-2">
										<form:input id="enabled" path="enabled" maxlength="20" class="form-control"/>
									</div>
								</div>
								<div class="form-group">
									<label for="remark" class="col-sm-2 control-label">备注:</label>
									<div class="col-sm-2">
										<form:input id="remark" path="remark" maxlength="20" class="form-control"/>
									</div>
								</div>
						<div class="form-group">
						  <div class="col-sm-offset-2 col-sm-10">
						    <input class="btn btn-primary" type="submit" value="保 存"/>
							<input class="btn btn-default" type="button" value="返 回" onclick="history.go(-1)"/>
						  </div>
						</div>
					</form:form>
				  </div>
				</div>			
			</div>
		</div>
	</div>
</body>
</html>